package com.leadingsoft.pwxk.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseStatus;
import org.springframework.web.bind.annotation.RestController;

import com.leadingsoft.pwxk.converter.AuditPublicInfoConverter;
import com.leadingsoft.pwxk.dto.AuditPublicInfoDto;
import com.leadingsoft.pwxk.service.AuditPublicInfoService;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;

/**
 * 
 * @author ysh
 *
 */
@Api(description = "信息公开相关")
@RestController
@RequestMapping("api/auditPublicInfo")
public class AuditPublicInfoController {

	@Autowired
	AuditPublicInfoService auditPublicInfoService;

	@Autowired
	AuditPublicInfoConverter auditPublicInfoTableConverter;

	@ApiOperation("信息公开列表")
	@GetMapping(path = "{dataId}")
	@ResponseStatus(code = HttpStatus.OK)
	public List<AuditPublicInfoDto> getList(@PathVariable(value = "dataId") String dataId) {
		return auditPublicInfoTableConverter.toListDto(auditPublicInfoService.getList(dataId));
	}
}
